UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QS4tLslJKbcoV+l+kRTXNQMn5K0fEZcGtK/+ZEJ47w4=' 
WHERE 
  key_id = '32039d562e1e88b030fb8b822e22baf909dc4e58a686a84b472694b8c72a5881' 
  AND (
    token = 'QS4tLslJKbcoV+l+kRTXNQMn5K0fEZcGtK/+ZEJ47w4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034