UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Q4mSwPqWDZ4cE2lVTz/G+thoJLt6P9MaAHXiZxQo/I8=' 
WHERE 
  key_id = '484f602ba1e587804e2faa47e314b36049ff03113d4e9e18ac9835728b3134d4' 
  AND (
    token = 'Q4mSwPqWDZ4cE2lVTz/G+thoJLt6P9MaAHXiZxQo/I8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035