UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '59e3pe9Jcq0WWerzvERt+TUZw/t+gzR4qiZBkIssp/k=' 
WHERE 
  key_id = '47c11d220a51557b88179f42d860ed724ca6bfa173cba0a584bfcec4a1b2cf7b' 
  AND (
    token = '59e3pe9Jcq0WWerzvERt+TUZw/t+gzR4qiZBkIssp/k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040