UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RpzHKBfmyovddmF8D/LMPvBQQPIXqe+C4kGxonlELfc=' 
WHERE 
  key_id = '012ea5419872ae79a4e5025c5a2f29e3a5905fc914488ed22786bccfbc923ba5' 
  AND (
    token = 'RpzHKBfmyovddmF8D/LMPvBQQPIXqe+C4kGxonlELfc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025