UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Qe+VuySQoGI7umRlt21Z796mZr8dfpl7A1sNVKpxi8s=' 
WHERE 
  key_id = '779a1d167a3f7cc0dccd403c601f741e9fe5ca74026fbf625f046581fb9a0573' 
  AND (
    token = 'Qe+VuySQoGI7umRlt21Z796mZr8dfpl7A1sNVKpxi8s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026