UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TUxmWUeWyk6Zqdv0nNv6wZHRtzRz6byYEqXkXXDqf3w=' 
WHERE 
  key_id = '848b07cd48ac88fbec36b6a5c74f73bd001323622b47b571d19d2a52eea526d9' 
  AND (
    token = 'TUxmWUeWyk6Zqdv0nNv6wZHRtzRz6byYEqXkXXDqf3w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032