UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wAZjfNkhidTuxOTQBz/su8yeRH+WAoq1CIXOXtJybCU=' 
WHERE 
  key_id = '35504e6274ddf38d808ce9aa49c442a5d9f2df3b9d3048ee9cdd11ce5c43cbad' 
  AND (
    token = 'wAZjfNkhidTuxOTQBz/su8yeRH+WAoq1CIXOXtJybCU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00085