UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3LwHu09KmDGso/TADLGGernQE3N7kcZUFxc2PU1kZNA=' 
WHERE 
  key_id = 'a4de735fc66c5b7648be791f3b0fe56cb19ebf60e20658e69818adf2f7d956df' 
  AND (
    token = '3LwHu09KmDGso/TADLGGernQE3N7kcZUFxc2PU1kZNA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027