UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UaClQDuQma/V1JBulx4QqW2Nl+niRHcVBAHDNCu/8W0=' 
WHERE 
  key_id = 'd7a9589cc9c1ac8fb682ecb85e1b4934279c7a89d308f0029863871f1f396162' 
  AND (
    token = 'UaClQDuQma/V1JBulx4QqW2Nl+niRHcVBAHDNCu/8W0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00068