UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FTfltp7Tbl/9iOxwFG+CrGWb8KcQ2uQ2jHCpDw6vQKU=' 
WHERE 
  key_id = '34ec48e9713a9e588d6c13e99a1f19a2556ce98dcc8173207336d7502530adc8' 
  AND (
    token = 'FTfltp7Tbl/9iOxwFG+CrGWb8KcQ2uQ2jHCpDw6vQKU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033