UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kkvPLF5XZR9QyWm5JK9hSn+BhlLYEWLlWxz4cybFw8k=' 
WHERE 
  key_id = 'abb599c6c1c2313eb62e686c85140c1e61d64272898bacdad80b7ccf114ec1f4' 
  AND (
    token = 'kkvPLF5XZR9QyWm5JK9hSn+BhlLYEWLlWxz4cybFw8k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030