UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'M8jL5WcKY0eEdMZwRYpRrWF62IUoP0IDCSyWT4BLY1k=' 
WHERE 
  key_id = '007341ad7abc12972ec008a5866a674b731be02bb9c41e01a425ebb7819040c9' 
  AND (
    token = 'M8jL5WcKY0eEdMZwRYpRrWF62IUoP0IDCSyWT4BLY1k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021