UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Rq1rFb7d/5VbCYUvCcqC9aCd6f5qs2NIkIBjTQrg93k=' 
WHERE 
  key_id = '6d4a0cbec99d1b1af54c66e2c9b611e34563fade0aac85cfdc435621666fdc4a' 
  AND (
    token = 'Rq1rFb7d/5VbCYUvCcqC9aCd6f5qs2NIkIBjTQrg93k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039