UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vJYGkWfkpNf+rmlh/StYhaHwNblQ8MgD0jGJS/xhSzQ=' 
WHERE 
  key_id = 'c19161594bf3e991b70a73b11e249502c37eadfce4a15bf499319b09f2d5d0b1' 
  AND (
    token = 'vJYGkWfkpNf+rmlh/StYhaHwNblQ8MgD0jGJS/xhSzQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039