UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pGuKL5GEXaO+BwzGonUfToY8fUIotQdodeHbALGmyaY=' 
WHERE 
  key_id = '832a38e77859afeee770777b7d8db19ca8eb5e20f5b97db3a8965e5740428588' 
  AND (
    token = 'pGuKL5GEXaO+BwzGonUfToY8fUIotQdodeHbALGmyaY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022