UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1rEcLo1uZSge6spBRKputGQaDz3WWOvG7i5oP+RKjyU=' 
WHERE 
  key_id = '0a88aa27997dfd57d7b7e3f2c4f1d8b151d0d22bd0aa631dcad6257178491434' 
  AND (
    token = '1rEcLo1uZSge6spBRKputGQaDz3WWOvG7i5oP+RKjyU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031