UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8LzB+tvOUdruaMaGUg1j+jGz681igKvvpNZj0lvnwz0=' 
WHERE 
  key_id = '2f62bfac337c33d2687133dd7f14495c73c9ef438913282bc2f856c1e3125904' 
  AND (
    token = '8LzB+tvOUdruaMaGUg1j+jGz681igKvvpNZj0lvnwz0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043