UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tUQwomR4A2SqA+HceOPZTXTfdNyEi2Hy+lXxFxQQECc=' 
WHERE 
  key_id = '4d7676b5a038075d058e71b9cd99396ef0cad4e5fa57d686940949c1f1018c49' 
  AND (
    token = 'tUQwomR4A2SqA+HceOPZTXTfdNyEi2Hy+lXxFxQQECc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018