UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RKcju31hParptXB+AdOKSn/6iqPMjvgXnOJp4S3/nAg=' 
WHERE 
  key_id = '66321ad0e609e6de771dc4199517dbac449b68eaed8f4cd42d7768fca5f0cad9' 
  AND (
    token = 'RKcju31hParptXB+AdOKSn/6iqPMjvgXnOJp4S3/nAg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030