UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ieJVQjCE4UJKu9StSZna75Ecbm1VbprvZe/KwY32+3g=' 
WHERE 
  key_id = '6e8981d98367e9fdc8b7a5edff2d76b82c11a55aa09474b9cbe1d63e23753fe6' 
  AND (
    token = 'ieJVQjCE4UJKu9StSZna75Ecbm1VbprvZe/KwY32+3g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020