UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nOYLj6WDeyvhTBz5r+FE8xvmwjxJQR+t1UqvmO97cRo=' 
WHERE 
  key_id = '3e2c10d3fff210263aec128702bd29bc98ca138b93a5a041c635e9d139a40c2a' 
  AND (
    token = 'nOYLj6WDeyvhTBz5r+FE8xvmwjxJQR+t1UqvmO97cRo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033