UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+2ggxgv07+Apdm+8RRBQQeLfPL56UZY8K4f5khiTpJQ=' 
WHERE 
  key_id = 'f47a41c701f962554c58d1435813d529d114ad7db533049a73ad9a032b53d190' 
  AND (
    token = '+2ggxgv07+Apdm+8RRBQQeLfPL56UZY8K4f5khiTpJQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028