UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BghU8CT9kLXWKI2ezo0ed8SlLzZu6p6vX1M/7xh6jZM=' 
WHERE 
  key_id = '3e9e99195e83676fbc7814d755f9201fc0a6304149d8e2461556d8deacc6ebbb' 
  AND (
    token = 'BghU8CT9kLXWKI2ezo0ed8SlLzZu6p6vX1M/7xh6jZM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026