UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4tEkkMYdn18XoVQ4U7gvIRCXzHeAsKNuBLEvxcRLTzc=' 
WHERE 
  key_id = '762c229f8f2827b77b1232f5cd9d8d25275ebb9e2994b719899fc99ec3b1a9b2' 
  AND (
    token = '4tEkkMYdn18XoVQ4U7gvIRCXzHeAsKNuBLEvxcRLTzc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046