UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wXn1IhfcbTjZ11Vsi1i6lWWXLq8hcpQdgiwni/PXlck=' 
WHERE 
  key_id = 'c914083c9af955a52a8105ca182fcd88bf26bd1c3e16673ea139ba701b8eaa21' 
  AND (
    token = 'wXn1IhfcbTjZ11Vsi1i6lWWXLq8hcpQdgiwni/PXlck=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028