UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'P8IR2vhTDJHXhwhozThGQQmC5Aia1FmrZ0O+IlKnHqc=' 
WHERE 
  key_id = 'd7ae5c0e3bf014275e63ce59a351e07e29788c92ab03b6a519ffbfade5c12779' 
  AND (
    token = 'P8IR2vhTDJHXhwhozThGQQmC5Aia1FmrZ0O+IlKnHqc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024