UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eNORjGSYOdiInx52DrLNGDn3LZUNExlp/PK7ITBIVxg=' 
WHERE 
  key_id = 'a15c52e47571f3c60d603e60349fb8971cfcfbfab49dd9e6c1ae6a3e96b5a5bf' 
  AND (
    token = 'eNORjGSYOdiInx52DrLNGDn3LZUNExlp/PK7ITBIVxg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030