UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VYfOhW2ky/VOpks9mNxLv8Z+A9vyBUDyV0JaET945XI=' 
WHERE 
  key_id = '7d4fe78f32885b00133cd8fcbfd01ab4f9f54405b1382c8643a89a802d8b153d' 
  AND (
    token = 'VYfOhW2ky/VOpks9mNxLv8Z+A9vyBUDyV0JaET945XI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033